//select赋值函数
function setSelect(objSelect,objItemText)
{   
	 //判断是否存在
     var isExit = false;
     for(var i=0;i<objSelect.options.length;i++)
     {
         if(objSelect.options[i].value == objItemText)
         {
             objSelect.options[i].selected = true;
             isExit = true;
             break;
         }
     }
}

//输入数字
function replaceNotNumber(hehe)
{
  var pattern = /[^0-9\.]/g;
  if(pattern.test(hehe.value))
  {
    hehe.value = hehe.value.replace(pattern,"");
  }
}


//获取ID
function get_obj(obj){
   return document.getElementById(obj);
}

//上传图片
function show_uplode(fn,dir,label)
{
    J.dialog.get({ id: 'test2', title: '上传文件',width: 435,height: 120, page: '/mxsoft/upfile2.php?fn='+fn+'&dir='+dir+'&label='+label, cover: true });
}
function upfile(url,name,size,p){
	document.getElementById(p).value=url;
}

//全选反选
function CheckAll(form,va){
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if(va=='all'){
			e.checked = true;
		}else{
			e.checked == true ? e.checked = false : e.checked = true;
		}
	}
}

